import Relay from "react-relay";

export default class ListOrderMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { listOrder }`;
    }

    getVariables() {
        return {
            argsInput: {
                pageSize: this.props.pageSize,
                pageNum: this.props.pageNum,
                token: this.props.token,
                type: this.props.type,
                status: this.props.status,
                enId: this.props.enId,

            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on listOrderPayload {
            listOrder {
                errorCode
                value
                totalResult
                id
                orders{
                   oid
                   enId
                   partAPhone
                   rmark
                   orderType
                   goodsInfo
                   createDate
                   status
                   partA
                   orderGoodsNum
                   partAName
                   payAccount
                   account
                   
                }
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
               fragment on listOrderPayload {
            listOrder {
                errorCode
                value
                totalResult
                id
                orders{
                   oid
                   enId
                   partAPhone
                   rmark
                   orderType
                   goodsInfo
                   createDate
                   status
                   partA
                   orderGoodsNum
                   partAName
                   payAccount
                   account
                }
                }
                }
            `]
        }];
    }

}